home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pbmpl91d.zip / PBMPLUS / README.DOS < prev   
Text File  |  1993-01-08  |  8KB  |  173 lines

  1. Disclaimer: This software is distributed WITHOUT ANY WARRANTY; without
  2. even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  3. PURPOSE.
  4.  
  5. PLEASE READ ALL THE INCLUDED README.* AND FAQ FILES BEFORE USING THIS
  6. PACKAGE.
  7.  
  8. To port pbmplus to dos using the djgpp compiler (gcc/g++), I did the
  9. following:
  10.  
  11. Configured the makefiles and and pbmplus.h as appropriate (about the
  12. only thing I did was set up to use gcc    with -O2 -funroll-loops and
  13. not to use X-windows color database).  Fixed makefiles to do not
  14. require a special shell (probably ms_sh*.zip package would work to make
  15. it not necessary to fix the makefile).    Added the command aout2exe $*
  16. to turn the final executable into an *.exe.
  17.  
  18. Added 2 programs not usually in the package:  ppmqvga and pnmcomp
  19. which do vga optimized quantization and image composition, respectively.
  20.  
  21. Fixed the p?mmerge files to handle *.exe in the 8.3 filename format, and
  22. added ppmqvga and pnmcomp to them.
  23.  
  24. Build tiff library WITHOUT the g3 support. (I don't think the tiff
  25. binaries use this code, and the compile the g3 statemachine took about
  26. 12 megs of memory, or about 45 minutes for that one file, since I only
  27. have 8 megs and my hard drive was thrashing pretty horendously).
  28.  
  29. Apply a fix to the djgpp libraries.  First made a modified startup code
  30. (set crt0new.s) and fix_io.c.  Added fix_io.o to libc.a and used the
  31. crt0new.o instead of crt0.o that came supplied with djgpp.    These modules
  32. basically lets us use binary files using dos pipes which normally can't be
  33. done.
  34.  
  35. make. Takes about 2 hours on my 386/sx-16 :-<
  36.  
  37. A zip of the stubbed exe's for the complete package is about 1.86 megs
  38. (using info-zip 1.9).  As a result, I will only be uploading the merged
  39. binaries (see below).
  40.  
  41. use cawf package to make man pages.
  42.  
  43.  
  44. The package (be it zip, zoo, whatever) will consists of the following:
  45.  
  46. bin/p?mmerge.exe                       executables
  47. bin/go32.exe                           The dos-extender
  48. bin/emu387                             387 emulator for those without
  49. bin/*.                                   script files that *may* work under
  50.                                        certain dos shells (4dos, ms_sh)
  51. man/*.man                               cawfed up man pages
  52. src/fix_io.c                           function to make io-default to binary
  53. src/crt0new.s                           new startup code to call above function
  54. newsrc/*.c                               src for progs not usually in pbmplus
  55. newsrc/*.1                               nroff files for above
  56. patch/*.dif                            few diffs (makefiles and pbmplus.h)
  57. readme                                   Jef's readme
  58. readme.dj                               DJ's readme for djgpp
  59. readme.dos                               this file
  60. faq                                    faq file for djgpp
  61.  
  62. This port of PBMPlus was compiled using the djgpp package, a port of
  63. the Free Software Foundation gcc/g++ compiler.    More info can be found
  64. in readme.dj.  This port REQUIRES a 386 processor or better as it uses
  65. 32-bit code.  Due to the nature of the dos-extender, DPMI (and hence
  66. ms-windows).  More info on this in the readme.dj and readme.1st files.
  67.  
  68. To install, but the file go32.exe somewhere in your path.  This is the
  69. actuall dos extender.  While I could have built the binaries with the
  70. extender built in, that does 2 things: makes it harder to upgrade the
  71. extender (when a new one comes out, just replace it), and makes the
  72. binaries larger.  The code that calls go32.exe is much smaller.
  73. You need to set an environment variable GO32TEMP to point to a temporary
  74. directory where you would like go32 to put its paging file (go32 will
  75. use virtual memory when you run out of real memory).
  76.  
  77. Something like:
  78. set GO32TEMP=c:\tmp
  79. is appropriate.  BE SURE THE DIRECTORY EXISTS!!
  80.  
  81. Put the other binaries (p?mmerge.exe) somewhere useful.
  82.  
  83. Since the compiled binaries take up so much room, I have decided to only post
  84. the merged binaries.  If you really want to install the normal binaries,
  85. the package builds easily with my patches.    Just get the official pbmplus
  86. package from export.lcs.mit.edu (18.24.0.12).
  87.  
  88. On unix systems, you can do what is called a 'link' to a file. Essentially
  89. what this does is gives the same file different names.    When the file is an
  90. executable, the name returned by argv[0] is what ever name you invoked it by.
  91. Some programs can examine argv[0] and change their functionality as a result.
  92. compress/uncompress/zcat does this.  All three programs are identical (and
  93. on many systems, the exact same file with multiple links).    Pbmplus uses
  94. this functionality to make smaller 'merged' binaries.  Instead of compiling
  95. each program with main(), each program in compiled with filename_main().
  96. A dispatch program (the p?mmerge.c file) calls the appropriate filename_main()
  97. based on what is in argv[0].  The result is you get one binary, slightly
  98. bigger than any individual binaries, but smaller than all of them put together
  99. becuase you are only linking in one copy of fprintf(), one copy of fopen(),
  100. one copy of ppm_readfile(), etc.
  101.  
  102. Now, since dos does not support links in its filesystem, you have to result
  103. to copying to get the functionality of the programs.
  104.  
  105. For example, if you want to take a 24-bit Targa file and quantize it to an
  106. 8 bit gif file for viewing, you would do the following:
  107.  
  108. copy ppmmerge.exe tgatoppm.exe
  109. copy ppmmerge.exe ppmqvga.exe
  110. copy ppmmerge.exe ppmtogif.exe
  111. tgatoppm my.tga | ppmqvga | ppmtogif > my.gif
  112.  
  113. Of course, if you use a certain utility a lot, you keep that one around.
  114. If you occasionally need a certain functionality, you can copy the merged
  115. binary to the appropriate name, use it, then delete it.  If you want to
  116. keep the entire ppmplus package on line, I would recommend building it
  117. yourself.  Takes about 4 megs to keep all the stubbed exe's around. What
  118. I do is keep unmerged copies of the files I use all the time and the
  119. p?mmerge files.  When I occasionally come across something I don't have,
  120. I can use the merged binary.  You can usually figure out which merged binary
  121. to use by the name of the program you want.  Any program that handles
  122. multiple p?m types will be in the higher ranking of the merged binaries.
  123. ie, pbmtopgm is in pgmmerge, pgmtoppm is in ppmmerge, etc
  124.  
  125. Known Bugs:
  126. I only know of 2 bugs in the package.
  127.  
  128. The first are the tiff based binaries.    While tifftopnm and pnmtotiff will
  129. read each others files, I can't get either to work with files produced with
  130. Graphics Workshop.    This is a result more of the tiff UNstandard than anything
  131. else.  Surprisingly, CompuSHOW will handle tiffs produced by both GWS and PMB+
  132. with no problem.  Go figure.
  133.  
  134. The second is under DESQview (at least version 2.42).  Since way that the
  135. dos extender changes stdin to handle BINARY files will cause a hang of a
  136. session if you don't redirect input into the file.
  137.  
  138. Example:
  139. you can always to the following:
  140.  
  141. ppmtogif my.ppm > my.gif
  142. or
  143. ppmtogif < my.ppm > my.gif
  144.  
  145. If you try the following from outside DV:
  146.  
  147. ppmtogif > my.gif
  148.  
  149. It will read from the keyboard, and you could enter a ppm file by typing it in
  150. (why you would want to I don't know).  If you try that from inside DV, it
  151. will hang that window and you will have to manually close it (not even
  152. control-c will break out of it).  Usually, the only time this will cause a
  153. problem is when you write a pipeline and forget to supply the initial file.
  154. If anyone uses a DV specific shell (one that supports multiprocessing, and
  155. uses true pipes instead of intermdiate files), this should work.  I'd be
  156. interested in hearing if it appears any faster than using a ramdrive to hold
  157. the tempfile (this can be controlled by some command shells, such as 4dos,
  158. and command.com as supplied in msdos 5.0 and dr-dos 5.0 and up).
  159.  
  160. The tiff bug, I'm not too worried about.  It *may* also be a problem with
  161. files produced on a unix system, but I haven't the opportunity to track
  162. down the problem.  The other bug I'm not sure what the cause is, and
  163. it will probably take better programmer than I to fix.
  164.  
  165. If you have any problems, comments, etc, I can be reached at:
  166.  
  167. Mike Castle
  168. 1204 N. Pine, Apt 5       NOTE: School address.  never know when might change
  169. Rolla, MO 65401           suddenly.
  170.  
  171. mcastle@cs.umr.edu
  172. S087891@umrvma.umr.edu
  173.